package net.bhzyxy.azyy;


import android.app.Application;
import android.content.Context;
import android.view.WindowManager;
import android.widget.Toast;

//优先级最高的文件，程序首先运行此文件的所有代码
//单例设计模式
public class App extends Application {

    private static App app;

    public static App get() {
        return app;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
    }

    public int getWidth() {
        WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
        return wm.getDefaultDisplay().getWidth();
    }

}
